﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Admin/Main.master"
    Title="图片列表" CodeFile="CodeList.aspx.cs" Inherits="Admin_CodeList" %>

<%@ Register TagPrefix="uc" TagName="ContentMenu" Src="~/Admin/ContentMenu.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="LeftMenu" runat="Server">
    <uc:ContentMenu ID="ContentMenu" runat="server" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MidContent" runat="Server">
    <div id="mainMenu">
        <ul>
            <li><a href="CodeAdd.aspx">添加图片</a> </li>
            <li>
                <asp:HyperLink ID="ArticleLink" runat="server">图片列表</asp:HyperLink></li><li><a href="CodeEdit.aspx">
                    编辑图片</a></li></ul>
    </div>
    <div id="main">
        <asp:Label ID="Msg" runat="server" Text="" CssClass="msg" Visible="False"></asp:Label>
        <asp:GridView ID="ArticleList" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            OnPageIndexChanging="ArticleList_PageIndexChanging" DataKeyNames="cId,codeClassid"
            OnRowCancelingEdit="ArticleList_RowCancelingEdit" OnRowEditing="ArticleList_RowEditing"
            OnRowUpdating="ArticleList_RowUpdating" PageSize="15" OnRowDeleting="ArticleList_RowDeleting"
            CellPadding="0" CssClass="gv" Width="100%" EmptyDataText="暂无任何图片" OnRowDataBound="ArticleList_RowDataBound">
            <Columns>
                <asp:BoundField DataField="cid" HeaderText="ID">
                    <ControlStyle CssClass="gvOrderId" />
                </asp:BoundField>
                <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="120px" HeaderText="类型">
                    <ItemTemplate>
                        <%#Eval("codeClassid").ToString()=="1"?"单图":"幻灯片"%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Title" HeaderText="图片标题" ReadOnly="True" SortExpression="Title" />
                <asp:HyperLinkField DataNavigateUrlFields="imgPath" HeaderText="图片预览" Target="_blank"
                    Text="图片预览" />
                <asp:BoundField DataField="AddTime" HeaderText="添加时间" ReadOnly="True" SortExpression="AddTime" />
                <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="80px" HeaderText="启用">
                    <ItemTemplate>
                        <asp:CheckBox ID="ProductsLock" runat="server" AutoPostBack="True" Checked='<%# Eval("isOk").ToString() == "True" ? true:false %>'
                            OnCheckedChanged="ProductsLock_CheckedChanged" />
                    </ItemTemplate>
                    <ItemStyle CssClass="gvBtAField" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="操作" ShowHeader="False">
                    <EditItemTemplate>
                        <asp:Button ID="UpdateBt" runat="server" CausesValidation="True" CommandName="Update"
                            Text="更新" />
                        <asp:Button ID="CancelBt" runat="server" CausesValidation="False" CommandName="Cancel"
                            Text="取消" />
                    </EditItemTemplate>
                    <ItemStyle CssClass="gvCommandField" />
                    <ItemTemplate>
                        &nbsp;<asp:Button ID="DelBt" runat="server" CausesValidation="False" CommandName="Delete"
                            Text="删除" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="编辑图片">
                    <ItemStyle CssClass="gvBtAField" />
                    <ItemTemplate>
                        <asp:HyperLink ID="EditHyperLink" runat="server" NavigateUrl='<%# Eval("cid", "CodeEdit.aspx?cId={0}") %>'
                            Text="编辑图片"></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <RowStyle CssClass="gvRow" />
            <EditRowStyle CssClass="gvEditRow" />
            <PagerStyle CssClass="gvPage" />
            <HeaderStyle CssClass="gvHeader" />
            <AlternatingRowStyle CssClass="gvAlternatingRow" />
        </asp:GridView>
    </div>
    <div id="pic-window" class="x-hidden">
        <div class="x-window-header">
            图片预览</div>
    </div>

    <script language="JavaScript" type="text/javascript">
        topMenuThisPage(2);//当前位置顶部菜单标识
        contentSubMenuThisPage();//当前位置左侧菜单标识
        mainMenuThisPage(2);//当前选项卡标识
        showPic();//预览图片
    </script>

</asp:Content>
